/*
 * Copyright 2011 J. Auer, J. Andert, F.-J. Jendrusch, U. Celebi
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package de.fuberlin.replication.application.android.os;

import android.os.AsyncTask;
import de.fuberlin.replication.application.Synchronizable;

/**
 * Abstract asynchronous task for synchronizable applications.
 * 
 * @param <Params> the type of the parameters sent to the task upon execution.
 * @param <Progress> the type of the progress units published during the background computation.
 * @param <Result> the type of the result of the background computation.
 */
public abstract class SynchronizableTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
	private Synchronizable synchronizable;

	/**
	 * Constructor.
	 * 
	 * @param synchronizable the synchronizable application.
	 */
	public SynchronizableTask(Synchronizable synchronizable) {
		this.synchronizable = synchronizable;
	}

	/**
	 * Returns the synchronizable application.
	 * 
	 * @return the synchronizable application.
	 */
	protected Synchronizable getSynchronizable() {
		return synchronizable;
	}
}